//
// Created by harrybao on 2019/3/27.
//

#ifndef CMAKE_MATH_DEFINE_H
#define CMAKE_MATH_DEFINE_H

#define EPSINON 0.000001f
#define MINUSEPSINON -0.000001f
#define ROPI	3.1415926f
#define RORound 360.0f
#define RODeg2Rad(x) ((x) * 0.0174533f)
#define RORad2Deg(x) ((x) * 57.295780f)
#define RORoundToCircle(x) (float(((int)(x) % (int)RORound) + (float)((x) - (int)(x))))
#define ROIsNaN(x) (assert(!_isnan(x)))
#define ROClamp(x, minValue, maxValue) (std::max(std::min((x), (maxValue)), (minValue)))
#define ROIsInteger(x) ((std::abs(x - (int)x) < 0.0001f) || (std::abs(x - (int)x) > (1 - 0.0001f)))
#define ROIsZeroNumber(x) ((x) < EPSINON && (x) > -EPSINON)
#define ROIsNumberEqual(x, y) (fabs((x)-(y)) < EPSINON)

#endif //CMAKE_MATH_DEFINE_H
